<m-center>
  <m-card [autoHeight]="true">
    <div card-head>
      <div class="g-card-title">资产设备认证</div>
      <ng-container *ngIf="editing; else editBtnRef">
        <div>
          <button class="btn btn-secondary mr-3" (click)="cancel()">取消</button>
          <button class="btn btn-primary" (click)="submit()">保存</button>
        </div>
      </ng-container>
      <ng-template #editBtnRef>
        <ng-container *ngIf="user$ | async as user">
          <button *ngIf="user.is_super" class="btn btn-primary" (click)="edit()">编辑配置</button>
        </ng-container>
      </ng-template>
    </div>
    <form [formGroup]="formGroup" class="form-group row align-items-center">
      <div class="col-2">
        <label for="assetsFile">内部资产设备清单</label>
      </div>
      <div class="col-6">
        <m-script-input formGroupName="assetsFile"
          (select)="onSelect($event)"
          (view)="onClickView($event)"
          (downTemp)="onDownTemp($event)"
          [nameSuffixNot]="['xlsx']"
          viewBtnText="下载"
          orther="下载模板"
          >
        </m-script-input>
      </div>
    </form>
  </m-card>
  <m-history [type]="'zone'" [length]="8"></m-history>
</m-center>
